package com.funcourse.demo.model.repo;

import com.funcourse.demo.model.PicMeta;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

public interface PicMetaRepo extends ElasticsearchRepository<PicMeta,String> {

  Page<PicMeta> findByTags(String content, Pageable pageable);

  @Query("{ \"query_string\" : { \"query\" : \"?0\", \"fields\" : [ \"tags\" ] } }")
  Page<PicMeta> findByTagsString(String tags, Pageable pageable);
}
